home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
packet
/
terminal
/
top_152
/
src152.exe
/
rar
/
TOPLIB.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-05-16
|
33KB
|
1,457 lines
{┌─────────────────────────────────────────────────────────────────────────┐}
{│ │}
{│ T. O. P. │}
{│ │}
{│ (T)he (O)ther (P)acket │}
{│ │}
{│ T O P L I B . P A S │}
{│ │}
{│ │}
{│ Library - Unit mit oft benötigten Routinen │}
{└─────────────────────────────────────────────────────────────────────────┘}
Function Channel_ID (* Kanal : Byte) : Str5 *);
Var Bstr : String[5];
Begin
Bstr := TNC[K[Kanal]^.TncNummer]^.Ident;
if length(Bstr) > 0 then Bstr := Bstr + B1;
Channel_ID := Bstr;
End;
Procedure Warten;
Var KC : Sondertaste;
VC : Char;
Begin
Repeat Until _Keypressed;
_ReadKey(KC,VC);
End;
Procedure Triller;
Var i : Byte;
Begin
for i := 1 to 6 do
begin
Beep(600,50);
Beep(800,50);
end;
End;
Procedure C_Bell;
Var i : Byte;
Begin
if Klingel then for i := 1 to 10 do
begin
Beep(G^.C_Freq1,G^.C_Delay1);
Beep(G^.C_Freq2,G^.C_Delay2);
end;
End;
Procedure D_Bell; (* Klingel beim Disconnect *)
Var i : Integer;
Begin
i := 2000;
Repeat
i := i-25;
Sound(i);
Verzoegern(1);
Until i < 100;
NoSound;
End;
Procedure Daten_Bell;
Begin
Sound(1400);
Verzoegern(100);
NoSound;
Verzoegern(80);
Sound(1400);
Verzoegern(40);
NoSound;
End;
Function Datum (* : Str11 *);
Var Tag,
WoTag,
Monat,
Jahr : Word;
TagStr,
WoTagStr,
MonatStr,
JahrStr : String[2];
Dummy : String[8];
Begin
GetDate(Jahr,Monat,Tag,WoTag);
Dummy := Uhrzeit;
TagStr := SFillStr(2,'0',int_str(Tag));
MonatStr := SFillStr(2,'0',int_str(Monat));
JahrStr := copy(int_str(Jahr),3,2);
WochenTag := ParmStr(WoTag+1,B1,WeekDayStr);
WotagStr := copy(WochenTag,1,2);
Datum := WotagStr + B1 + TagStr + Pkt + MonatStr + Pkt + JahrStr;
End;
Function Uhrzeit (* : Str8 *);
Var Stunden,
Minuten,
Sekunden,
Sek100,
UtcStd : Word;
Flag : Boolean;
Hstr : String[8];
Begin
GetTime(Stunden,Minuten,Sekunden,Sek100);
UtcStd := Stunden;
UtcStd := UtcStd + 24 + ZeitDiff;
While UtcStd > 23 do UtcStd := UtcStd - 24;
Hstr := SFillStr(2,'0',int_str(Stunden)) + DP +
SFillStr(2,'0',int_str(Minuten)) + DP +
SFillStr(2,'0',int_str(Sekunden)) + DP;
UtcZeit := SFillStr(2,'0',int_str(UtcStd)) + copy(Hstr,3,6);
Uhrzeit := Hstr;
End;
Function GetCursorSize : Integer; (* Liefert Cursorgroesse (aus PCT von DD6CV) *)
Var r : Registers;
Begin
r.AH := $03;
intr($10,r);
GetCursorSize := r.CX;
End;
Procedure SetCursorSize(Size : Integer); (* Setzt Cursorgroesse (aus PCT von DD6CV) *)
Var r : Registers;
Begin
r.AH := $01;
r.CX := Size;
intr($10,r);
End;
Procedure Cursor_aus; (* Schaltet Cursor aus. (aus PCT von DD6CV) *)
Const CursorOffBit = 8192;
Begin
SetCursorSize(GetCursorSize or CursorOffBit);
Cursor_On := false;
End;
Procedure Cursor_ein; (* Schaltet Cursor ein. (aus PCT von DD6CV) *)
Const CursorOnMask = -8193;
Begin
SetCursorSize(GetCursorSize and CursorOnMask);
Cursor_On := true;
End;
Procedure Beep (* Ton,Laenge : Word*);
Begin
if Laenge > 0 then
begin
NoSound;
Sound(Ton);
Verzoegern(Laenge);
NoSound;
end;
End;
Procedure Fenster;
Var i,x,y : Byte;
Attr : Byte;
Begin
Attr := Attrib[3];
x := 1;
Teil_Bild_Loesch(7,15,Attr);
x := 40-(length(G^.Fstr[7]) DIV 2);
WriteRam(x,7,Attr,1,G^.Fstr[7]);
WriteRam(1,8,Attr,1,ConstStr('═',80));
for i := 9 to 15 do WriteRam(G^.Fstx[i],i,Attr,1,G^.Fstr[i]);
End;
Procedure clrFenster;
Var i : Byte;
Begin
for i := 7 to 15 do G^.Fstr[i] := '';
for i := 7 to 15 do G^.Fstx[i] := 1;
End;
Procedure Status2;
Var AByte,
Beg,
Ende,
C,i,
Z,UT : Byte;
ch : Char;
Hstr : String[80];
Xstr : String[6];
Flag : Boolean;
Begin
i := 0;
Repeat
Flag := not (i in [Portstufe+1..Portstufe+10]) and K[i]^.connected;
inc (i);
Until (i > maxLink) or Flag;
if Flag then ch := '*'
else ch := B1;
Hstr := ch;
Beg := PortStufe + 1;
Ende := Beg + 9;
if Ende > maxLink then Ende := maxLink;
for C := Beg to Ende do with K[C]^ do
begin
if connected then
begin
Xstr := Call;
Strip(Xstr);
end else
if Test then Xstr := 'T (' + int_str(TestMerk) + ')' else
begin
if Kstat then Xstr := EFillStr(6,B1,SFillStr(4,B1,int_str(C)))
else Xstr := ConstStr('─',6);
end;
if Mo.MonActive then
begin
Xstr := CutStr(Mo.MonStr[1]);
strip(Xstr);
end;
if (C > 0) and (C = ConvHilfsPort) then Xstr := 'SYSOP';
Xstr := EFillStr(6,B1,Xstr);
Hstr := Hstr + KStatTr;
Hstr := Hstr + Xstr;
end;
Hstr := Hstr + KStatTr;
Hstr := EFillStr(80,B1,Hstr);
UT := K[show]^.UnStat;
WriteRam(1,UT,Attrib[15],1,Hstr);
if show = 0 then i := Unproto
else i := K[show]^.TncNummer;
WriteRam(73,UT,Attrib[30],1,SFillStr(8,B1,TNC[i]^.QRG_Akt));
Z := 0;
for C := Beg to Ende do
begin
inc(Z);
with K[C]^ do
begin
if (show = C)
then AByte := Attrib[17]
else if NochNichtGelesen then AByte := Attrib[8]
else if Mo.MonActive then AByte := Attrib[25]
else if connected then AByte := Attrib[16]
else AByte := Attrib[15];
WriteAttr((Z*6)+Z-4,UT,6,AByte,1);
end;
end;
if maxLink > 10 then for C := 1 to maxLink do with K[C]^ do
begin
if NochNichtGelesen and not (C in [(Portstufe+1)..(Portstufe+10)]) then
begin
Hstr := EFillStr(6,B1,'CH:' + int_str(C));
Z := C mod 10;
if Z = 0 then Z := 10;
i := show mod 10;
if i = 0 then i := 10;
if Z <> i then AByte := Attrib[8]
else AByte := Attrib[17];
WriteRam((Z*6)+Z-4,UT,AByte,1,Hstr);
end;
end;
End;
Procedure Alarm;
Begin
if Klingel then Beep(G^.Alarm_Freq,G^.Alarm_Time);
End;
Procedure StatusOut (* Kanal,x,Nr,Attr : Byte ; Zeile : str20 *);
Var N,Nx,i : Byte;
Begin
with K[Kanal]^ do
begin
N := (((NrStat[Nr]-1) * 40) + (2 * x) - 1);
Nx := (NrStat[Nr]-1) * 40 + 1;
for i := 1 to ord(Zeile[0]) do
begin
StatZeile[N] := Zeile[i];
inc(N);
StatZeile[N] := chr(Attr);
inc(N);
end;
if not ScreenSTBY then
begin
if (Kanal = show) and not DirScroll then
begin
if Backscroll(show) and (Nr <> 2)
then move(StatZeile[Nx],Bild^[(ObStat-1)*160+Nx],40)
else move(StatZeile,Bild^[(ObStat-1)*160+1],160);
end;
end;
end;
End;
Procedure NodeConnect (* Kanal : Byte; Zeile : Str80 *);
Var i : Byte;
Bstr,
Hstr : String[80];
Begin
with K[Kanal]^ do
begin
Hstr := Zeile;
if length(Zeile) > 1 then NodeCmd := false;
Zeile := CutStr(Zeile);
if Zeile > '' then
begin
Bstr := InfoZeile(216);
while (Bstr > '') and not NodeCmd do
begin
if pos(Zeile,CutStr(Bstr)) = 1 then NodeCmd := true
else Bstr := RestStr(Bstr);
end;
if NodeCmd then ConnectMerk := Hstr;
end;
end;
End;
Function Exists (* name : Str80) : Boolean *);
Var Datei : Text;
Begin
if Name > '' then
begin
Assign(Datei,name);
(*$I-*) Reset(Datei); (*$I+*)
if IOResult = 0 then
begin
Exists := true;
Close(Datei);
end else Exists := false;
end else Exists := false;
End;
Procedure Teil_Bild_Loesch (* y,y1,Attr : Byte *); (* Zeilen von y bis y1 löschen *)
Begin
if not ScreenSTBY then
Asm les di, Bild
mov al, y
dec al
mov ah, 160
mul ah
add di, ax
mov al, y1
mov ah, 160
mul ah
sub ax, di
mov cx, ax
mov al, 32
mov ah, Attr { Attribut laden }
shr cx, 1
@Again:
mov [es:di], ax { Zeichen mit Attr übertragen }
add di, 2
Loop @Again
end;
End;
Procedure InfoOut; (* Kanal,AL,NewPic : Byte; Zeile : Str80 *)
Var AMerk,
Tr,x,l : Byte;
Begin
if length(Zeile) > 78 then Zeile[0] := Chr(78);
if (Kanal = show) and not BackScroll(Kanal) then
begin
if NewPic = 1 then Neu_Bild;
if Kanal > 0 then Tr := K[Kanal]^.QBeg
else Tr := K[Kanal]^.UnStat + 1;
if not HardCur and (length(Zeile) < 76) then Zeile := B1 + Zeile + B1;
if volle_Breite then Zeile := EFillStr(78,B1,Zeile);
l := length(Zeile);
x := (80 - l) div 2;
XL := x;
XR := x + l + 2;
WriteRam(x,Tr,15,1,'┌' + ConstStr('─',l) + '┐');
WriteRam(x,Tr+1,15,1,'│' + Zeile + '│');
WriteAttr(x+1,Tr+1,l,Attrib[3],1);
WriteRam(x,Tr+2,15,1,'└' + ConstStr('─',l) + '┘');
if LastInfoFlag then
WriteRam(x+1,Tr,15,1,B1+int_str(LastInfoOut^.KA[LastInfoCount])+B1);
NowFenster := true;
BoxZaehl := Box_Time;
NowCurBox := true;
if (AL = 1) and Klingel then Beep(G^.PopFreq,G^.PopFreqTime);
if not LastInfoFlag then
begin
for l := maxInfoOut-1 downto 1 do
begin
LastInfoOut^.IZ[l+1] := LastInfoOut^.IZ[l];
LastInfoOut^.KA[l+1] := LastInfoOut^.KA[l];
end;
LastInfoCount := 0;
LastInfoOut^.IZ[1] := Zeile;
LastInfoOut^.KA[1] := Kanal;
KillEndBlanks(LastInfoOut^.IZ[1]);
KillStartBlanks(LastInfoOut^.IZ[1]);
end;
set_Hardwarecursor(Kanal);
K[Kanal]^.MerkInfo := '';
end else K[Kanal]^.MerkInfo := Zeile;
End;
Procedure max_path_ermitteln;
Var Hstr : String[80];
Begin
maxPath := 0;
FiResult := ResetTxt(G^.LinkFile);
Repeat
Readln(G^.LinkFile,Hstr);
if pos(DP,Hstr) > 0 then inc(maxPath);
Until Eof(G^.LinkFile);
FiResult := CloseTxt(G^.LinkFile);
End;
Procedure WriteAttr (* X_Pos,Y_Pos,Count,Attr,Aufruf : Byte *);
Begin
if not ScreenSTBY then
begin
if not ((Aufruf = 0) and BackScroll(show)) then
Asm xor ch, ch
mov cl, Count
cmp cl, 0
je @Ende
les di, Bild
mov al, Y_Pos
dec al
mov ah, 160
mul ah
add di, ax
mov al, X_Pos
shl al, 1
dec al
xor ah, ah
add di, ax
mov al, Attr { Attribut laden, }
@Again:
mov [es:di], al { und schreiben }
add di, 2
loop @Again
@Ende:
end;
end;
End;
Procedure WritePage (* Kanal,X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80 *);
Var Attr1 : Byte;
Begin
if not ScreenSTBY then
begin
if (Aufruf = 1) or (Kanal = show) then
begin
Attr1 := Attrib[1];
AusStr := Zeile;
Asm mov si, Offset AusStr
xor ch, ch
mov cl, [ds:si]
test cl, $FF
jz @Ende
inc si
les di, Bild
mov al, Y_Pos
mov ah, 160
dec al
mul ah
mov di, ax
mov al, X_Pos
shl al, 1
dec al
dec al
xor ah, ah
add di, ax
cld
@Again:
mov ah, Attr
lodsb
cmp al, 32
jae @Weiter
test al, $FF
jz @Weiter
mov bl, WCTRL
test bl, $FF
jz @1
mov ah, Attr1
add al, 64
@1:
@Weiter:
mov [es:di], ax
add di, 2
Loop @Again
@Ende:
end;
end;
end;
End;
{
Procedure WritePage (* Kanal,X_Pos,Y_Pos,Attr : Byte ; Zeile : Str80 *);
var Attr1,i : Byte;
ch : char;
Position : Integer;
aktuell : Boolean;
Begin
if not ScreenSTBY then
begin
if (Aufruf = 1) or (Kanal = show) then
begin
Position := pred(Y_Pos) * 160 + pred(X_Pos shl 1);
for i := 1 to length(Zeile) do
Begin
ch := Zeile[i];
if ch < #32 then
begin
Attr1 := Attrib[1];
if WCTRL then ch := chr(ord(ch) + 64);
end else Attr1 := Attr;
Bild^[Position] := ch;
inc(Position);
Bild^[Position] := chr(Attr1);
inc(Position);
end;
end;
end;
End;
}
Procedure WriteRam (* X_Pos,Y_Pos,Attr,Aufruf : Byte; Zeile : Str80 *);
Begin
if not ScreenSTBY then
begin
if not ((Aufruf = 0) and BackScroll(show)) then
begin
AusStr := Zeile;
Asm mov si, Offset AusStr
xor ch, ch
mov cl, [ds:si]
test cl, $FF
jz @Ende
inc si
les di, Bild
mov al, Y_Pos
mov ah, 160
dec al
mul ah
mov di, ax
mov al, X_Pos
shl al, 1
sub al, 2
xor ah, ah
add di, ax
mov ah, Attr
cld
@Again:
lodsb
mov [es:di], ax
add di, 2
Loop @Again
@Ende:
end;
end;
end;
End;
{
Procedure WriteRam(X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80);
var i : Byte;
ch : char;
ch1 : char;
Position : Integer;
Begin
if not ScreenSTBY then
begin
ch1 := chr(Attr);
Position := (pred(Y_Pos) * 160) + pred(X_Pos shl 1);
if not ((Aufruf = 0) and BackScroll(show)) then
begin
for i := 1 to ord(Zeile[0]) do
Begin
Bild^[Position] := Zeile[i];
Position := Succ(Position);
Bild^[Position] := ch1;
Position := Succ(Position);
end;
end;
end;
End;
}
Procedure WriteTxt (* X_Pos,Y_Pos,Attr : Byte; Zeile : Str80 *);
Begin
AusStr := Zeile;
Asm mov si, Offset AusStr
xor ch, ch
mov cl, [ds:si]
test cl, $FF
jz @Ende
inc si
les di, Bild
mov al, Y_Pos
mov ah, 160
dec al
mul ah
mov di, ax
mov al, X_Pos
shl al, 1
sub al, 2
xor ah, ah
add di, ax
mov ah, Attr
cld
@Again:
lodsb
mov [es:di], ax
add di, 2
Loop @Again
@Ende:
end;
End;
Procedure WriteBios (* Kanal,X_Pos,Y_Pos,Attr,Aufruf : Byte ; Zeile : Str80 *);
Var XM,YM,i,
Attr1 : Byte;
VC : Char;
Reg : Registers;
Begin
if not ScreenSTBY then
begin
if (Aufruf = 1) or (Kanal = show) then
begin
XM := WhereX;
YM := WhereY;
Attr1 := Attrib[1];
for i := 1 to length(Zeile) do
begin
VC := Zeile[i];
Reg.AH := $02;
Reg.BH := $00;
Reg.DH := Y_Pos - 1;
Reg.DL := X_Pos - 1;
Intr($10,Reg);
if WCTRL and (Ord(VC) in [1..31]) then
begin
Reg.AH := $09;
Reg.AL := Ord(VC) + 64;
Reg.BH := $00;
Reg.BL := Attr1;
Reg.CX := $01;
Intr($10,Reg);
end else
begin
Reg.AH := $09;
Reg.AL := Ord(VC);
Reg.BH := $00;
Reg.BL := Attr;
Reg.CX := $01;
Intr($10,Reg);
end;
inc(X_Pos);
end;
GotoXY(XM,YM);
end;
end;
End;
Function KanalFrei (* Kanal : Byte) : Byte *);
Var Free : Boolean;
i : Byte;
Begin
Free := false;
i := maxLink;
While not Free and (i > 0) do with K[i]^ do
begin
if not Kanal_benutz and
not connected and
not Test and
not Mo.MonActive and
(Cself = 0) and
(i <> ConvHilfsPort) and
(i <> Kanal) then
begin
Free := true;
KanalFrei := i;
end else dec(i);
end;
if not Free then KanalFrei := 0;
End;
Function Line_convert (* Kanal, Art : Byte; Zeile : String) : String *);
Var i : Byte;
Begin
with K[Kanal]^ do
begin
if Umlaut = 2 then
begin
case Art of
1 : For i := 1 to length(Zeile) do
case Zeile[i] of
'Ä' : Zeile[i] := '[';
'Ö' : Zeile[i] := BS ;
'Ü' : Zeile[i] := ']';
'ä' : Zeile[i] := '{';
'ö' : Zeile[i] := '|';
'ü' : Zeile[i] := '}';
'ß' : Zeile[i] := '~';
end;
2 : For i := 1 to length(Zeile) do
case Zeile[i] of
'[' : Zeile[i] := 'Ä';
BS : Zeile[i] := 'Ö';
']' : Zeile[i] := 'Ü';
'{' : Zeile[i] := 'ä';
'|' : Zeile[i] := 'ö';
'}' : Zeile[i] := 'ü';
'~' : Zeile[i] := 'ß';
end;
end;
end
else if Umlaut = 3 then
begin
case Art of
1 : For i := 1 to length(Zeile) do
case Zeile[i] of
'Ä' : Zeile[i] := '─';
'Ö' : Zeile[i] := '╓';
'Ü' : Zeile[i] := '▄';
'ä' : Zeile[i] := 'Σ';
'ö' : Zeile[i] := '÷';
'ü' : Zeile[i] := 'ⁿ';
'ß' : Zeile[i] := '▀';
end;
2 : For i := 1 to length(Zeile) do
case Zeile[i] of
'─' : Zeile[i] := 'Ä';
'╓' : Zeile[i] := 'Ö';
'▄' : Zeile[i] := 'Ü';
'Σ' : Zeile[i] := 'ä';
'÷' : Zeile[i] := 'ö';
'ⁿ' : Zeile[i] := 'ü';
'▀' : Zeile[i] := 'ß';
end;
end;
end;
end;
Line_convert := Zeile;
End;
Function InfoZeile; (* (Nr : Word) : String[80] *)
Var Hstr : String[80];
i,x : Word;
Begin
Hstr := '';
x := (MsgPos^[Nr+1] - MsgPos^[Nr]);
move(Msg^[MsgPos^[Nr]],Hstr[1],x);
Hstr[0] := chr(Byte(x));
InfoZeile := Hstr;
End;
Procedure Neu_Bild;
Const ScrMax = NeuBildRam + 1;
RetMax = 60;
Type ScreenPtr = array[0..ScrMax] of Byte;
ReturnPtr = array[0..RetMax] of Word;
Var Zeilen,i : Integer;
Screen : ^ScreenPtr;
Return : ^ReturnPtr;
Procedure Picture(C,von,bis,Attr : Byte);
Var i1 : Integer;
Farb,
Z,J : Byte;
Groesse,
P : LongInt;
Hstr : String[80];
ch : char;
i : Word;
NotPtr : Pointer;
RetPtr : Pointer;
Begin
FillChar(Return^,SizeOf(Return^),0);
FillChar(Screen^,SizeOf(Screen^),0);
Return^[0] := ScrMax-1;
if use_EMS then EMS_Seite_einblenden(C,Scr);
if use_Vdisk then
begin
FiResult := ResetBin(ScrollFile,T);
with K[C]^ do
if NotPos + 1 < ScrMax then
begin
Seek(ScrollFile,Pos_im_Scr+(maxNotCh-ScrMax+NotPos));
BlockRead(ScrollFile,Screen^[0],ScrMax-NotPos-1,i);
Seek(ScrollFile,Pos_im_Scr);
BlockRead(ScrollFile,Screen^[ScrMax-NotPos-1],NotPos,i);
end else
begin
Seek(ScrollFile,Pos_im_Scr+(NotPos+1-ScrMax));
BlockRead(ScrollFile,Screen^[0],ScrMax-1,i);
end;
FiResult := CloseBin(ScrollFile);
end else
if use_XMS then
begin
with K[C]^ do if NotPos + 1 < ScrMax then
begin
XMS_to_Data(@Screen^[0],XMS_Handle,Pos_im_Scr+(maxNotCh-ScrMax+NotPos),ScrMax-NotPos-1);
XMS_to_Data(@Screen^[ScrMax-NotPos-1],XMS_Handle,Pos_im_Scr,NotPos);
end else XMS_to_Data(@Screen^[0],XMS_Handle,Pos_im_Scr+(NotPos+1-ScrMax),ScrMax-1);
end else
begin
with K[C]^ do if NotPos + 1 < ScrMax then
begin
move(NotCh[C]^[maxNotCh-ScrMax+NotPos],Screen^[0],ScrMax-NotPos-1);
move(NotCh[C]^[0],Screen^[ScrMax-NotPos-1],NotPos);
end else move(NotCh[C]^[NotPos+1-ScrMax],Screen^[0],ScrMax-1);
end;
Screen^[ScrMax-1] := 13;
NotPtr := @Screen^[ScrMax-2];
RetPtr := @Return^[0];
Asm cli
push DS
mov cx, ScrMax
dec cx
dec cx
xor bl, bl
lds si, RetPtr
les di, NotPtr
jmp @Again
@AddZ:
add si, 2
mov [ds:si], cx
dec cx
inc bl
cmp bl, RetMax
jae @Ende
@Again:
mov al, [es:di]
dec di
cmp al, 13
je @AddZ
Loop @Again
@Ende:
pop DS
mov Z, bl
sti
end;
(*
Z := 0;
for i := max-2 downto 0 do
begin
if (Screen^[i] = 13) and (Z < a) then
begin
inc(Z);
RET[Z] := i;
end;
end;
*)
if Zeilen <= Z then Z := Zeilen;
for i := 1 to Z do
begin
Hstr := '';
Farb := ord(Screen^[Return^[i]+1]);
if Farb = 254 then Farb := 13;
J := Return^[i-1] - Return^[i] - 2;
if J > 80 then J := 80;
move(Screen^[Return^[i]+2],Hstr[1],J);
Hstr[0] := chr(J);
Teil_Bild_Loesch(bis+1-i,bis+1-i,Farb);
WritePage(show,1,bis+1-i,Farb,0,Hstr);
end;
if (bis-Z) >= von then Teil_Bild_Loesch(von,bis-Z,Attr);
end;
Begin
NowFenster := false;
NowCurBox := false;
ScreenSTBY := false;
SetzeFlags(show);
Status2;
GetMem(Screen,SizeOf(Screen^));
GetMem(Return,SizeOf(Return^));
if show = 0 then
begin
Zeilen := maxZ - K[0]^.UnStat;
Picture(0,K[0]^.UnStat+1,maxZ,Attrib[29]);
TickerOut;
end else
begin
Zeilen := K[show]^.QEnd - K[show]^.QBeg + 1;
Picture(show,K[show]^.QBeg,K[show]^.QEnd,Attrib[18]);
Zeilen := maxZ - K[show]^.UnStat;
if Zeilen > 0 then Picture(0,K[show]^.UnStat+1,maxZ,Attrib[29]);
end;
FreeMem(Return,SizeOf(Return^));
FreeMem(Screen,SizeOf(Screen^));
Neu_BildVor(show);
Soft_Cursor(show);
if HardCur then
begin
JumpRxZaehl := 0;
JumpRxScr := true;
end;
notScroll := true;
if not BackScroll(show) and (K[show]^.MerkInfo > '') then
InfoOut(show,0,0,K[show]^.MerkInfo);
End;
Procedure SetzeFlags (* Kanal : Byte *);
Var S : String[20];
Procedure mS (Hstr : Str2);
Begin
S := S + Hstr;
End;
Begin
with K[Kanal]^ do
begin
StatusOut(Kanal,1,3,Attrib[9],ConstStr(B1,20));
S := '';
if Kanal > 0 then
begin
if Einstiegskanal or AusstiegsKanal then mS(int_str(GegenKanal));
if Kopieren > 0 then mS(int_str(Kopieren));
if FileSend then mS('Tx');
if RX_Bin > 0 then mS('Rx');
if SplSave then mS('*')
else if SPlus then mS('+');
if BufExists then mS('%');
if AutoBin then mS('&');
if RemAll then mS('!');
if Ignore then mS('-');
if not BinOut then mS('#');
if SysopParm then mS('s');
if SysArt in SysMenge then mS('B')
else if Auto then mS('F');
if Auto_CON then mS('c');
if Rx_Beep then mS('G');
if Hold and not FileSend then mS('H');
if CSelf in [5,6] then mS('a')
else if CSelf > 0 then mS('A');
end else
begin
if CtrlBeep then mS('G');
if PacOut then mS('L');
if Time_stamp then mS('T');
if TNC[Unproto]^.Bake then mS('B');
if NoBinMon then mS('#');
end;
if TopBox then if EigMail then mS('m')
else mS('M');
if RxComp then mS('r');
if TxComp then mS('t');
if not RX_Save and Save then mS('Sv');
if Umlaut > 0 then mS('U');
if Echo > 0 then mS('E');
if Klingel then mS('K');
if Print then if Drucker then mS('P')
else mS('p');
if G^.MakroLearn then mS('l');
StatusOut(Kanal,1,3,Attrib[14],S);
end;
End;
Procedure ScreenFill; (* Bildschirm-Schoner *)
Var X,Y : Byte;
Begin
ScreenSTBY := false;
Teil_Bild_Loesch(1,maxZ,0);
ScreenSTBY := true;
Repeat
X := Random(70);
Until X in [1..70];
Repeat
Y := Random(maxZ);
Until Y in [1..maxZ];
WriteTxt(X,Y,Attrib[15],BSTOP);
End;
Procedure Check_Eig_Mail (* von,bis : Byte *);
Var Hstr : String[9];
i : Byte;
Begin
for i := von to bis do with K[i]^ do
begin
Hstr := OwnCall;
strip(Hstr);
if Exists(G^.MailPfad + Hstr + MsgExt) then
begin
if pos(Hstr,Eig_Mail_Zeile) = 0
then Eig_Mail_Zeile := Eig_Mail_Zeile + B1 + Hstr;
EigMail := true;
end else EigMail := false;
end;
End;
Procedure EMS_Seite_einblenden (* Kanal : Byte; Art : Byte *);
Var i : Byte;
Begin
with K[Kanal]^ do
begin
if Art = Scr then for i := 0 to PagesAnz-1 do
EMS_Zuordnung(ScrHandle,i,PagesNot[i]);
if Art = Vor then EMS_Zuordnung(VorHandle,0,Kanal);
if EMS_Error <> 0 then Abbruch_TOP(10,int_str(EMS_Error));
end;
End;
Procedure Open_Scroll (* Kanal : Byte *);
Begin
with K[Kanal]^ do
begin
FiResult := ResetBin(ScrollFile,T);
Seek(ScrollFile,Pos_im_Scr + NotPos);
end;
End;
Procedure Close_Scroll (* Kanal : Byte *);
Begin
with K[Kanal]^ do
begin
NotPos := FilePos(ScrollFile) - Pos_im_Scr;
FiResult := CloseBin(ScrollFile);
end;
End;
Function PhantasieCall; (* : str9 *)
Var ch : char;
Hstr : String[9];
Begin
Hstr := '';
While length(Hstr) < 7 do
begin
ch := #0;
While not (ch in ['A'..'Z']) do ch := chr(Random(Byte(90)));
Hstr := Hstr + ch;
end;
Hstr[4] := chr(Random(Byte(9)) + 48);
Hstr[7] := '-';
Hstr := Hstr + int_str(Random(Byte(15)));
PhantasieCall := Hstr;
End;
Procedure SetzeCursor (* X,Y : ShortInt *);
Begin
if not Cursor_on then Cursor_Ein;
X := Byte(X);
Y := Byte(Y);
if (CurX <> X) or (CurY <> Y) then GotoXY(X,Y);
CurX := X;
CurY := Y;
End;
Procedure InitCursor (* X,Y : ShortInt *);
Begin
if HardCur then SetzeCursor(X,Y);
End;
Procedure set_Hardwarecursor (* Kanal : Byte *);
Var i,i1,i2,i3 : Byte;
begin
if HardCur then with K[Kanal]^ do
begin
i := QBeg + 1;
i1 := 3;
i3 := QEnd;
if Kanal = 0 then
begin
i := UnStat + 2;
i1 := 1;
i3 := maxZ;
end;
if Braille80 then i2 := 80 else i2 := 1;
if NowCurBox and not NoCurJump
then SetzeCursor(XL,i)
else if not TNC_ReadOut then
begin
if (Kanal = 0) then SetzeCursor(1,UnStat);
end else if JumpRxScr and Win_Rout then
begin
if ShTab_Pressed then SetzeCursor(i1,ObStat)
else SetzeCursor(i2,i3);
end else
begin
if Cmd then SetzeCursor(X1C,Y1C+Vofs)
else SetzeCursor(X1V,Y1V+Vofs);
end;
end;
End;
Procedure SwitchChannel(Kanal : Byte);
Begin
if Kanal > 0 then PortStufe := ((Kanal-1) div 10) * 10;
show := Kanal;
K[Kanal]^.NochNichtGelesen := false;
Neu_Bild;
End;
Procedure SwitchKanal (* VC : Char *);
Var i,i1,i2 : Byte;
Flag : Boolean;
Begin
i := (ord(VC)-58);
i1 := show;
if maxLink > 10 then
begin
if i1 - PortStufe = i then
begin
if i1 + 10 <= maxLink then i1 := i1 + 10 else
begin
i1 := i;
if i1 = 0 then i1 := maxLink;
end;
end else
begin
i1 := i + PortStufe;
if i1 > maxLink then i1 := i;
end;
i2 := i1;
Repeat
if i2 + 10 <= maxLink then i2 := i2 + 10
else i2 := i;
Flag := K[i2]^.NochNichtGelesen;
Until Flag or (i2 = i1);
if Flag then i1 := i2;
end else i1 := i;
if i1 > maxLink then i1 := maxLink;
SwitchChannel(i1);
End;
Procedure SwitchMonitor;
Begin
if show > 0 then
begin
ShowMerk := show;
SwitchChannel(0);
end else SwitchChannel(ShowMerk);
End;
Function FreeStr (* Lw : char) : str11 *);
Begin
FreeStr := FormByte(int_str(DiskFree(ord(Lw)-64)));
End;
Function V24 (* Kanal : Byte) : Byte *);
Begin
V24 := TNC[K[Kanal]^.TncNummer]^.RS232;
End;
Procedure ReInstall;
Begin
V24_Close;
Port[$21] := Old_IntMask;
Port[$20] := $C7;
if use_EMS then EMS_Freigeben(ScrHandle);
if Vor_im_EMS then EMS_Freigeben(VorHandle);
if use_XMS then Free_XMS_Ram(XMS_Handle);
NormVideo;
ColorItensity(false);
TextMode(StartVideoMode);
ClrScr;
Cursor_ein;
End;
Procedure ColorItensity (* CFlag : Boolean *);
var r : Registers;
i : Byte;
Begin
if not Hercules then
begin
if CFlag then i := 0
else i := 1;
r.AX := $1003;
r.BL := i;
Intr($10,r);
end;
End;
Function ChAttr (* Attr : Byte ) : Byte *);
Begin
if Attr = 13 then ChAttr := 254 else ChAttr := Attr;
End;
Procedure Init_HardDrive;
Var r : Registers;
Begin
r.AH := $0D;
MsDos(r);
HD_Read := 0;
End;
Procedure New2BVec;
Begin
ES := Seg(TopString);
DI := Ofs(TopString);
End;
Procedure Check_TOP_Loaded;
Var r : Registers;
p : ^String;
Begin
r.ES := 0;
r.DI := 0;
Intr(TEI,r);
p := Ptr(r.ES,r.DI);
if (p <> nil) and (p^ = TopString) then
begin
Writeln(^G,'TOP already loaded !');
Halt;
end;
End;
Procedure TOP_Exit;
Begin
ExitProc := OrigExit;
ReInstall;
GotoXY(1,25);
Writeln(^G);
End;
Procedure PRG_Stoppen(Nr : Byte);
Begin
ExitProc := OrigExit;
Halt(Nr);
End;
Function BackScroll (* Kanal : Byte) : Boolean *);
Begin
with K[Kanal]^ do BackScroll := QsoScroll or BoxScroll or DirScroll;
End;
Procedure Call_DOS (* Zeile : Str128 *);
Begin
SetIntVec(TEI,@New2Bvec);
SetMemTop(Ptr(OvrHeapOrg,0));
SwapVectors;
Exec(GetEnv('COMSPEC'),Zeile);
SwapVectors;
SetMemTop(HeapEnd);
OvrClearBuf;
SetIntVec(TEI,Old2Bvec);
End;
Function AppendTxt (* Var f : Text) : Integer *);
Begin
(*$I-*) Append(f); (*$I+*)
AppendTxt := IOResult;
End;
Function ResetTxt (* Var f : Text) : Integer *);
Begin
(*$I-*) Reset(f); (*$I+*)
ResetTxt := IOResult;
End;
Function ResetBin (* Var f : File; Fpos : LongInt) : Integer *);
Begin
(*$I-*) Reset(f,Fpos); (*$I+*)
ResetBin := IOResult;
End;
Function RewriteTxt (* Var f : Text) : Integer *);
Begin
(*$I-*) Rewrite(f); (*$I+*)
RewriteTxt := IOResult;
End;
Function RewriteBin (* Var f : File; Fpos : LongInt) : Integer *);
Begin
(*$I-*) Rewrite(f,Fpos); (*$I+*)
RewriteBin := IOResult;
End;
Function CloseTxt (* Var f : File) : Integer *);
Begin
(*$I-*) Close(f); (*$I+*)
CloseTxt := IOResult;
End;
Function CloseBin (* Var f : File) : Integer *);
Begin
(*$I-*) Close(f); (*$I+*)
CloseBin := IOResult;
End;
Function EraseTxt (* Var f : File) : Integer *);
Begin
(*$I-*) Erase(f); (*$I+*)
EraseTxt := IOResult;
End;
Function EraseBin (* Var f : File) : Integer *);
Begin
(*$I-*) Erase(f); (*$I+*)
EraseBin := IOResult;
End;
Procedure IdleDOS;
Var r : Registers;
Begin
r.AX := $1680;
Intr($2F,r);
End;
Procedure Verzoegern (* Wert : Word *);
Begin
Delay(Word(Round(Wert * DelayCor)));
End;
Procedure LockIntFlag (* Art : Byte *);
Begin
if LockInt then
begin
if Art = 0 then Inline($FA)
else Inline($FB);
end;
End;
Function FName_aus_FVar (* var f : File) : Str80 *);
Var Hstr : String[80];
i : Byte;
Begin
move(FileRec(f).Name,Hstr[1],80);
i := 1;
While (Hstr[i] > #0) and (i < 80) do inc(i);
Hstr[0] := Chr(i-1);
KillEndBlanks(Hstr);
FName_aus_FVar := Hstr;
End;